Skip to content

Conversation

@inner-daemons
Copy link
Collaborator

@inner-daemons inner-daemons commented Dec 17, 2025

Connections
Part of #7197
Closes #7219
Related to #8739
Depends on #8756

Description
Adds support for mesh shaders to HLSL writer. There still exist some things to do:

  • Possibly disable some mesh outputs that are unused in the fragment shader

Testing
Existing tests, snapshots

Squash or Rebase?
Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@cwfitzgerald cwfitzgerald self-assigned this Jan 7, 2026
Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, the youzh

Comment on lines +102 to +103
@mesh(mesh_output) @workgroup_size(2, 1, 1)
fn ms_divergent(@builtin(local_invocation_id) thread_id_1: vec3<u32>) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our HLSL writer has a bug where it doesn't consider the local_invocation_index being written by the zero-initializer/mesh shader output loop to be a builtin. So I had to use an alternative here, since local_invocation_index was being used elsewhere

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a bug about this somewhere?

@inner-daemons
Copy link
Collaborator Author

inner-daemons commented Jan 16, 2026

@cwfitzgerald One question here, not probably too important:

Can you explain to me whats going on in naga::back::hlsl::Writer::write_ep_output_struct? It seems to be removing some HLSL outputs but as far as I can tell DX12 allows the vertex shader to output @location things unused by the fragment shader. I'm not sure if I should be doing this in the mesh shader writer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mesh Shading for DirectX 12

2 participants